Skip to content

#1076 : Filesystem allow-list bypass fix#1077

Merged
dgageot merged 1 commit intodocker:mainfrom
jeanlaurent:fix-1076
Dec 13, 2025
Merged

#1076 : Filesystem allow-list bypass fix#1077
dgageot merged 1 commit intodocker:mainfrom
jeanlaurent:fix-1076

Conversation

@jeanlaurent
Copy link
Copy Markdown
Member

Fix path traversal vulnerability in filesystem allow-list

Fixes #1076

Problem

The isPathAllowed() function used a naive prefix check that allowed sibling directories with similar names to bypass the allow-list. When /home/user/project was allowed, paths like /home/user/project-secrets or /home/user/project2 would incorrectly be granted access.

Solution

Changed from strings.HasPrefix(absPath, allowedAbs) to require either an exact match or a path separator after the allowed directory prefix:

Signed-off-by: Jean-Laurent de Morlhon <jeanlaurent@morlhon.net>
@jeanlaurent jeanlaurent requested a review from a team as a code owner December 13, 2025 09:53
@dgageot dgageot merged commit ac8bd5c into docker:main Dec 13, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Filesystem allow-list bypass via naive prefix check in isPathAllowed

2 participants